package com.top10.service.impl;



import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.top10.common.DatabaseConst;
import com.top10.entity.Advertise;
import com.top10.mapper.AdvertiseMapper;
import com.top10.service.AdvertiseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdvertiseServiceImpl implements AdvertiseService {

	@Autowired
	private AdvertiseMapper advertiseMapper;
	public List<Advertise> getAdvertise(Integer type)throws Exception{
		return  advertiseMapper.selectList(new EntityWrapper<Advertise>().eq("type",type).eq("isdeleted",DatabaseConst.IS_DELETED_NO).last("LIMIT 3"));
	}
}
